{extend name='public/base' /}

{block name='seo' /}
<title>{$title|default='标题'}</title>
<meta name="keywords" content="{$keywords|default='关键字'}">
<meta name="description" content="{$desc|default='描述'}">
{/block}


{block name='content' /}
<section class="Hui-article-box">
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
        <span class="c-gray en">&gt;</span>
        课程管理
        <span class="c-gray en">&gt;</span>
        课程分类 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a> </nav>
    <div class="Hui-article">
        <article class="cl pd-20">

            <div class="cl pd-5 bg-1 bk-gray mt-20">
				<span class="l">
					<a href="javascript:;" onclick="member_add('添加课程分类','{:url("course/courseLevelAdd")}','','320')" class="btn btn-primary radius">
						<i class="Hui-iconfont">&#xe600;</i>
						添加课程分类
                    </a>
				</span>
                <span class="r">共有数据：<strong>{$count}</strong> 条</span>
            </div>

            <table class="table table-border table-bordered table-bg">
                <thead>

                <tr class="text-c">
                    <th>ID</th>
                    <th>课程分类</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>

                {volist name="list" id="list"}
                <tr class="text-c">
                    <td>{$list.id}</td>
                    <td>{$list.level_name}</td>
                    <td>{$list.create_time}</td>
                    <td class="td-manage">

                        {if condition="$list.id neq 1"}
                        <a title="编辑" href="javascript:;" onclick="member_edit('课程分类编辑','{:url("course/courseLevelEdit",["id"=>$list["id"]])}','','510')" class="ml-5" style="text-decoration:none">
                        <i class="Hui-iconfont">&#xe6df;</i>
                        </a>
                        &nbsp; 	&nbsp;
                        <a title="删除" href="javascript:;" onclick="member_del(this,{$list.id})" class="ml-5" style="text-decoration:none">
                            <i class="Hui-iconfont">&#xe6e2;</i>
                        </a>
                        {else /}
                        <span>默认配置,不支持操作!</span>
                        {/if}

                    </td>
                </tr>
                {/volist}

                </tbody>
            </table>
            <div style="float: right">
                {$page}
            </div>

        </article>
    </div>

</section>

{/block}


{block name='js'}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__STATIC__/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__STATIC__/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="__STATIC__/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">


    /*用户-添加*/
    function member_add(title,url,w,h){
        layer_show(title,url,w,h);
    }

    /*用户-编辑*/
    function member_edit(title,url,w,h){
        $.get(url); //执行控制器中的编辑操作
        layer_show(title,url,w,h);
    }

    /*用户-删除*/
    function member_del(obj,id) {
        $.get("{:url('course/courseLevelDoDelete')}", {id: id});
        layer.confirm('确认要删除吗？', function (index) {
            $(obj).parents("tr").remove();
            layer.msg('已删除!', {icon: 1, time: 1000});
        });
    }


</script>
<!--/请在上方写此页面业务相关的脚本-->
{/block}
</body>
</html>